// webpack配置  commonjs规范
const path = require("path");
const {
  override,
  addDecoratorsLegacy,
  disableEsLint,
  // 直接使用它来定义import导入路径别名  @
  addWebpackAlias,
  // 按需加载
  fixBabelImports,
  addLessLoader,
} = require("customize-cra");
// const px2rem = require('postcss-px2rem')
module.exports = override(
  disableEsLint(),
  addDecoratorsLegacy(),

  // antd-mobile实现了按需加载
  fixBabelImports("import", {
    libraryName: "antd",
    style: true,
    libraryDirectory: "es",
  }),
  //使用less-loader对antd源码修改
  addLessLoader({
    modifyVars: { "@primary-color": "#1DA57A" },
    javascriptEnabled: true,
  })
);
